package com.shiguiwu.springmybatis.spring.createbean;

import org.springframework.beans.factory.FactoryBean;

/**
 * @description: 通过他
 * FactoryBean可以让spring容器通过这个接口的实现来创建我们需要的bean对象。
 * @author: stone
 * @date: Created by 2021/3/8 17:55
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.createbean
 */
public class PigFactoryBean  implements FactoryBean<Pig> {
    @Override
    public Pig getObject() throws Exception {
        return new Pig();
    }

    @Override
    public Class<Pig> getObjectType() {
        return Pig.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
